<?php 


include '../../function.php';

if($_POST){

	$data = $_POST;

	if(empty($_POST['username'])){
		error('用户名没填','./index.php',4);
		exit;
	}

	if(empty($_POST['password'])){
		error('内容没填','./index.php',4);
		exit;
	}

	unset($data['password2']);

	$data['password'] = md5($data['password']);
	
	
	$data['create_time']=time();

	$user = include './user.php';

	$user[]=$data;

	$user = var_export($user,true);

	$user = "<?php return ".$user."?>";

	file_put_contents('./user.php', $user);

	error('注册成功','./index.php',2);

}else{
	error('非法请求，需要通过首页表单提交','./index.php',4);
}










 ?>